﻿
/*
NAILSUPERSTORE ® COMPANY
 
[HISTORY]
Created By  	: NGUYEN VAN TY
Created Date	: 12/24/2010
Modified By     :
Modified Date   :
Note            :

*/

using System;
using System.Data;
using System.Configuration;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using System.Data.SqlClient;
using CommonTagTime.DataAccess;
using CommonTagTime.ModelObject;
namespace CommonTagTime.Business
{
    public class busContentPage
    {
        //------------------------------------------------
        //FIELD TABLE
        //------------------------------------------------
        public const string TABLE = "ContentPage";
        public const string PAGEID = "PageId";
        public const string PAGEURL = "PageURL";
        public const string TITLE = "Title";
        public const string CONTENT = "Content";
        public const string METADESCRIPTION = "MetaDescription";
        public const string METAKEYWORDS = "MetaKeywords";
        public const string NAME = "Name";     
        public const string CREATEDBY = "CreatedBy";
        public const string CREATEDDATE = "CreatedDate";
        public const string LANGUAGE = "Language";
        public const string UPDATEDBY = "UpdatedBy";
        public const string UPDATEDDATE = "UpdatedDate";       
        public const string ORDERBY = "OrderBy";
        public const string ORDERDIRECTION = "OrderDirection";
        public const string CURRENTPAGE = "CurrentPage";
        public const string PAGESIZE = "PageSize";     
        public const string TOTALRECORDS = "TotalRecords";
        public const string CONDITION = "Condition";
        private daoContentPage _daoContentPage;
        //------------------------------------------------
        //PUBLIC
        //------------------------------------------------
        public busContentPage()
        {
            _daoContentPage = new daoContentPage();
        }
        public int Insert(ContentPage objContentPage)
        {
            if (objContentPage == null)
                return 0;
            return _daoContentPage.Insert(objContentPage);
        }
        public int Update(ContentPage objContentPage)
        {
            if (objContentPage == null)
                return 0;
            return _daoContentPage.Update(objContentPage);
        }       
        public bool Delete(int ContentPageID)
        {
            if (ContentPageID <= 0)
                return false;
            return _daoContentPage.Delete(ContentPageID);
        }
        public ContentPage GetByID(int ContentPageID)
        {
            if (ContentPageID <= 0)
                return null;
            return _daoContentPage.GetByID(ContentPageID);
        }
        public ContentPage GetByURL(string url)
        {           
            return _daoContentPage.GetByURL(url);
        }
        public ContentPageCollection List(ContentPage objContentPage)
        {
            return _daoContentPage.List(objContentPage);
        }
        public ContentPageCollection GetAll(ContentPage objContentPage)
        {
            return _daoContentPage.GetAll(objContentPage);
        }
    }
}

